import request from "@/utils/request";

// GET /admin/acl/role/{page}/{limit} 获取角色分页列表
export const GetRolePageListApi = (page, limit, roleName) => {
  return request.get(`/admin/acl/role/${page}/${limit}?roleName=${roleName}`);
};

// POST /admin/acl/role/save  新增角色
export const saveRoleApi = (roleName) => {
  return request.post(`/admin/acl/role/save`, { roleName });
};

// PUT /admin/acl/role/update 修改角色
export const updateRoleApi = (id, roleName) => {
  return request.put(`/admin/acl/role/update`, { id, roleName });
};

// DELETE /admin/acl/role/remove/{id} 删除角色
export const removeRoleApi = (id) => {
  return request.delete(`/admin/acl/role/remove/${id}`);
};

// POST /admin/acl/role/batchRemove  根据id列表删除数据
// DELETE /admin/acl/role/batchRemove
export const removeRoleListApi = (idList) => {
  return request.post(`/admin/acl/role/batchRemove`, idList);
};